<template>
<div>
   <div class="g_top_box">
		<div class="g_right_box"></div> 
		<div class="g_left_box"><h4>团队信息</h4></div>
	</div>
	<div class="g_content_box">

		<Form :model="info" label-position="left" :label-width="100">
			<FormItem label="所属公司">
				<Select v-model="info.company_id" style="width:200px">
					<Option v-for="item in companyList" :value="item.id" :key="item.id">{{ item.name }}</Option>
				</Select>
			</FormItem>
			<FormItem label="名称">
				<Input v-model="info.name" style="width:200px;"></Input>
			</FormItem>
			
			<FormItem>
				<Button type="primary" @click="save">提交</Button>
			</FormItem>
		</Form>

	</div>
</div>
</template>

<script>
import Wcore from '@/libs/common';
export default {
    name: 'bumen_info',
    data (){
		
        return {
            info:{
				name:'',
				company_id:''
			},
			companyList:[]
        };
    },
	created(){
		this.$emit('change','team');
		this.load_comyany();
		
	},
    computed: {
       
    },
	methods:{
		load_comyany(){
			var self = this;
			var postdata = {
			
			};
			Whttp.load('User/Company/get_list',postdata,function(result){
				self.companyList = result.list;
			});
		},
		save(){
			var self = this;
			var postdata = {
				name:this.info.name,
				company_id:this.info.company_id,
			};
			Whttp.load('User/Team/save',postdata,function(result){
				self.$Message.info('添加成功');
				self.$router.back();
			});
		},
		
	}
};
</script>
<style scoped>

</style>